package com.traffic.api.service.impl;

import com.traffic.api.dao.VirtualTransitCardMapper;
import com.traffic.api.entity.VirtualTransitCard;
import com.traffic.api.service.VirtualTransitCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by churcy on 2017/3/2.
 */
@Service("virtualTransitCardServiceImpl")
public class VirtualTransitCardServiceImpl extends BaseServiceImpl<VirtualTransitCard, Integer> implements VirtualTransitCardService {

    @Autowired
    private VirtualTransitCardMapper virtualTransitCardMapper;

    @Override
    public List<VirtualTransitCard> findByConditions(Map<String, Object> conditions) {

        return virtualTransitCardMapper.findByConditions(conditions);
    }

    @Override
    public Map<String, Object> checkCard(Map<String, Object> conditions) {

        return virtualTransitCardMapper.checkCard((String) conditions.get("userId"), (String) conditions.get("deleted"), (String) conditions.get("result"));
    }

    @Override
    public VirtualTransitCard getByUserId(String userId) {
        return virtualTransitCardMapper.getByUserId(userId);
    }
}
